/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Slim
 */
@Embeddable
public class TravaillerAvecPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "NOM_GRADE")
    private String nomGrade;
    @Basic(optional = false)
    @Column(name = "NUMERO_DE_MATRICULE")
    private int numeroDeMatricule;

    public TravaillerAvecPK() {
    }

    public TravaillerAvecPK(String nomGrade, int numeroDeMatricule) {
        this.nomGrade = nomGrade;
        this.numeroDeMatricule = numeroDeMatricule;
    }

    public String getNomGrade() {
        return nomGrade;
    }

    public void setNomGrade(String nomGrade) {
        this.nomGrade = nomGrade;
    }

    public int getNumeroDeMatricule() {
        return numeroDeMatricule;
    }

    public void setNumeroDeMatricule(int numeroDeMatricule) {
        this.numeroDeMatricule = numeroDeMatricule;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nomGrade != null ? nomGrade.hashCode() : 0);
        hash += (int) numeroDeMatricule;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TravaillerAvecPK)) {
            return false;
        }
        TravaillerAvecPK other = (TravaillerAvecPK) object;
        if ((this.nomGrade == null && other.nomGrade != null) || (this.nomGrade != null && !this.nomGrade.equals(other.nomGrade))) {
            return false;
        }
        if (this.numeroDeMatricule != other.numeroDeMatricule) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.TravaillerAvecPK[ nomGrade=" + nomGrade + ", numeroDeMatricule=" + numeroDeMatricule + " ]";
    }
    
}
